<template>
    <div>
        <el-form :model="course_form"
            class="search_prod"
            label-width="120px">
            <el-form-item label="课程类别">
                <el-col :span="4">
                    <el-col :span="16"
                        class="search_input_width">
                        <el-select v-model="course_form.cid"
                            size="small"
                            clearable
                            placeholder="请选择"
                            style="width: 150px">
                            <el-option v-for="item in cate_option"
                                :key="item.id"
                                :label="item.cate_name"
                                :value="item.id"></el-option>
                        </el-select>

                    </el-col>
                </el-col>
                <el-col class="tr col_label"
                    :span="3">课程名称&nbsp;&nbsp;&nbsp;</el-col>
                <el-col :span="4">
                    <el-col :span="16"
                        class="search_input_width">
                        <el-input size="small"
                            clearable
                            placeholder="请输入课程名称"
                            v-model="course_form.title"></el-input>
                    </el-col>
                </el-col>

            </el-form-item>
            <el-form-item>
                <el-row class="tl">
                    <el-col :span="24">
                        <el-button size="mini"
                            type="primary"
                            @click="course_search_btn">查询</el-button>
                        <el-button size="mini"
                            type="primary"
                            @click="del_search_btn">一键清除</el-button>
                    </el-col>
                </el-row>
            </el-form-item>
        </el-form>
    </div>
</template>
<script>
export default {
  name: "coursesearch",
  data() {
    return {
      course_form: {
        cid: "",
        title: ""
      }
    };
  },
  props: {
    cate_option: {
      type: Array,
      default: []
    }
  },
  components: {},
  methods: {
    del_search_btn() {
      this.course_form = {
        cid: "",
        title: ""
      };

      this.$emit("send_search", this.course_form);
    },
    course_search_btn() {
      this.$emit("send_search", this.course_form);
    }
  }
};
</script>
<style scoped>
</style>
